<?php if (!defined('THINK_PATH')) exit(); /*a:1:{s:69:"E:\phpStudy\WWW\apply\public/../application/run\view\login\login.html";i:1523671427;}*/ ?>
<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

    <title>H+ 后台主题UI框架 - 登录</title>

    <link href="<?php echo $admin; ?>css/bootstrap.min.css" rel="stylesheet">
    <link href="<?php echo $admin; ?>layui-2.0/css/layui.css" rel="stylesheet">
    <link href="<?php echo $admin; ?>css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="<?php echo $admin; ?>css/animate.css" rel="stylesheet">
    <link href="<?php echo $admin; ?>css/style.css" rel="stylesheet">
    <link href="<?php echo $admin; ?>css/login.css" rel="stylesheet">
    <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html" />
    <![endif]-->
    <style>
        body.signin {
            background: #18c8f6;
            height: auto;
            background: url("<?php echo $admin; ?>img/call-to-action-bg.jpg") no-repeat center fixed;
            -webkit-background-size: cover;
            -moz-background-size: cover;
            -o-background-size: cover;
            background-size: cover;
            /* color: rgba(255, 255, 255, .95); */
        }

        .cor-fff {
            color: rgba(255, 255, 255, .95);
        }
    </style>
    <script>
        if (window.top !== window.self) {
            window.top.location = window.location;
        }
    </script>

</head>

<body class="signin">
    <div class="signinpanel">
        <div class="row cor-fff">
            <div class="col-sm-7 col-md-6">
                <div class="signin-info">
                    <div class="logopanel m-b">
                        <h1>[ 君忆汽车（爱车易得）]</h1>
                    </div>
                    <div class="m-b"></div>
                    <h4>欢迎使用
                        <strong>爱车易得后台管理系统</strong>
                    </h4>

                </div>
            </div>
            <div class="col-sm-5 col-md-6">
                <form class="layui-form">
                    <h4 class="no-margins">登录：</h4>
                    <p class="m-t-md">登录到爱车易得后台管理系统</p>
                    <!-- <div class="layui-form-item">
                        <label class="kit-login-icon">
                            <i class="layui-icon">&#xe612;</i>
                        </label>
                        <input type="text" name="username" lay-verify="required" autocomplete="off" placeholder="这里输入用户名." class="layui-input">
                    </div>
                    <div class="layui-form-item">
                        <label class="kit-login-icon">
                            <i class="layui-icon">&#xe642;</i>
                        </label>
                        <input type="password" name="password" lay-verify="required" autocomplete="off" placeholder="这里输入密码." class="layui-input">
                    </div> -->
                    <div class="layui-form-item">
                        <input type="text" name="username" class="form-control uname layui-input" placeholder="用户名" required lay-verify="required"
                            autocomplete="off" />
                    </div>
                    <div class="layui-form-item">
                        <input type="password" name="password" class="form-control pword m-b layui-input" placeholder="密码" required lay-verify="required"
                        />


                    </div>
                    <div class="layui-form-item">


                        <div style="position: relative">
                            <input type="number" name="code" class="form-control code m-b layui-input" placeholder="验证码" style="width:60%;" required
                                lay-verify="required" />
                            <div style="position:absolute;right:0;top:0">
                                <a href="javascript:;" style="float:right;display:block;border-left:2px solid green">
                                    <img src="<?php echo captcha_src(); ?>" class="code-click" onclick="this.src='<?php echo captcha_src(); ?>?'+Math.random();" width="120" height="38"
                                        alt="captcha" />
                                </a>
                            </div>

                        </div>
                    </div>
                    <button class="btn btn-success btn-block " lay-submit lay-filter="formDemo">登录</button>
                </form>
            </div>
        </div>
        <div class="signup-footer  cor-fff">
            <div class="" style="text-align:center">
                &copy; 2018 成都君忆汽车服务有限公司 All Rights Reserved
            </div>
        </div>
    </div>
</body>

</html>
<script src="<?php echo $admin; ?>js/jquery.min.js"></script>
<script src="<?php echo $admin; ?>js/bootstrap.min.js"></script>
<script src="<?php echo $admin; ?>layer/layer.js"></script>

<script src="<?php echo $admin; ?>layui-2.0/layui.js"></script>

<script type="text/javascript">
    layui.use(['layer', 'form'], function () {
        var layer = layui.layer,
            $ = layui.jquery,
            form = layui.form;
        form.on('submit(formDemo)', function (data) {

             //当前容器的全部表单字段，名值对形式：{name: value}

            $.post('<?php echo url("run/Login/checkLogin"); ?>', data.field, function (data) {
                console.log(data)
                
                switch (data) {
                    case 1:
                        window.location.href = "<?php echo url('run/Index/index'); ?>";
                        break;
                    case 0:
                        layer.msg('状态异常，请联系管理员', {
                            icon: 5,
                            time:1000
                        });
                        break;
                    case 2:

                        layer.msg('账号或密码输入错误', {
                            icon: 5,
                            time:1000
                            
                        });

                        break;
                    case 3:
                        $('.code-click').click();

                        layer.msg('验证码错误', {
                            icon: 5,
                            time: 1000
                        }, function () {
                            $("input[name='code']").select();
                        });

                        break;
                }
            })
            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });


    });
</script>